<template>
  <el-row>
    <el-col :span="24">
      <el-descriptions :column="2">
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="核销编码" />
          </template>
          {{ data.id }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="活动编码" />
          </template>
          {{ data.activityId }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="活动名称" />
          </template>
          {{ data.activityInfoName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="活动时间" />
          </template>
          {{ data.activityInfoTime }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="商家名称" />
          </template>
          {{ data.merchantName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="核销码" />
          </template>
          <el-popover placement="left" :width="226">
            <template #reference>
              <span class="cursor-pointer color-blue">查看</span>
            </template>
            <template #default>
              <Qrcode :text="data.verificationCode" />
            </template>
          </el-popover>
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="核销用户" />
          </template>
          {{ data.nickName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="核销商品" />
          </template>
          {{ data.productName }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="核销金额" />
          </template>
          {{ data.price }}
        </el-descriptions-item>
        <el-descriptions-item>
          <template #label>
            <descriptions-item-label label="核销时间" />
          </template>
          {{ formatDate(data.verificationTime) }}
        </el-descriptions-item>
      </el-descriptions>
    </el-col>
  </el-row>
</template>
<script setup lang="ts">
import { formatDate } from '@/utils/formatTime'

const { data } = defineProps<{ data }>()
</script>
<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
